<template>
    <div class="right vipLevel">
        <div class="level_tit tit clearfix">
            <span class="pull-left">管理员回复</span>
        </div>
        <h3>DeathGhost:</h3>
        <div class="vipMes">
            请帮我包的结实点，再送我个小礼品吧
        </div>
        <h3>管理员</h3>
        <div class="vipMes">
            <p><span>好的</span></p>
            <p v-for="i in arr">{{i[0]}}<span class="pull-right">{{i[1]}}</span></p>
        </div>
        <div class="type">
            <p><input type="text" v-model="replay"></p>
            <p><button class="btn btn-default btn-sm" v-on:click="clickEvent">回复</button></p>
        </div>
    </div>
</template>
<script>
    import orders from '../js/orders'

    export default{
        data(){
            return{
                orders:orders,
                cur:null,
                txt:"",
                arr:[],
                replay:""
            }
        },
        methods:{
            dele(ind){
                this.orders.splice(ind,1);
            },
            look(ind){
                this.cur = this.orders[ind];
            },
            clickEvent(){
                let addZero = n => n>9?n:"0"+n;
                if(this.replay){
                    let dat = new Date();
                    let time = dat.getFullYear()+"-"+(dat.getMonth()+1)+"-"+dat.getDate()+"-"+addZero(dat.getHours())+":"+addZero(dat.getMinutes())+":"+addZero(dat.getSeconds());
                    this.arr.push([this.replay,time]);
                }
            }
        },
        watch:{
            "$route":"pars"
        }
    }
</script>
<style lang="css" scoped>
    .level_tit{
        background:url("../images/vip_list_03.jpg") 5px 25px no-repeat;
        padding-bottom:10px;
    }
    .vipLevel h3{
        background:#fff;
        color:#3d3d3d;
        border-bottom:none;
        margin-bottom:0;
        text-indent:0;
    }
    .vipMes{
        background:#F1F1F1;
        line-height:30px;
    }
    .type{
        margin-top:30px;
    }
    .vipMes p{
        border-bottom:10px solid #fff;
        text-align:right;
    }
    .vipMes span{
        margin-right:50px;
        margin-left:20px;
    }
</style>